USE [OHNEW]
GO

/****** Object:  Table [dbo].[S_CodeRule]    Script Date: 11/19/2012 15:31:27 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[S_CodeRule](
	[ID] [varchar](50) NOT NULL,
	[DataTableName] [varchar](50) NOT NULL,
	[TableName] [varchar](50) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[SequenceExpression] [varchar](250) NOT NULL,
	[GroupSQLExpression] [varchar](250) NOT NULL,
	[GroupExpression] [varchar](250) NOT NULL,
	[GroupParameters] [varchar](250) NOT NULL,
	[CodeField] [varchar](50) NOT NULL,
	[CodeExpression] [varchar](250) NOT NULL,
	[CodeParameters] [varchar](250) NOT NULL,
	[SquenceLength] [int] NOT NULL,
	[Roize] [int] NOT NULL,
	[InitialValue] [int] NOT NULL,
	[SequenceField] [varchar](50) NULL,
 CONSTRAINT [PK_S_CodeRule] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[S_CodeRule] ADD  CONSTRAINT [DF_S_CodeRule_OrderNumber]  DEFAULT ((1)) FOR [OrderNumber]
GO

ALTER TABLE [dbo].[S_CodeRule] ADD  CONSTRAINT [DF_S_CodeRule_SquenceLength]  DEFAULT ((4)) FOR [SquenceLength]
GO

ALTER TABLE [dbo].[S_CodeRule] ADD  CONSTRAINT [DF_S_CodeRule_Roize]  DEFAULT ((1)) FOR [Roize]
GO

ALTER TABLE [dbo].[S_CodeRule] ADD  CONSTRAINT [DF_S_CodeRule_InitialValue]  DEFAULT ((1)) FOR [InitialValue]
GO


